package jtk.project4.fleet.resource.i18n;

import java.awt.Image;
import java.util.Locale;
import java.util.MissingResourceException;

import javax.swing.Icon;
import javax.swing.ImageIcon;

import nl.coderight.jazz.i18n.ResourceManager;

public class ResourceLoader extends ResourceManager{
	
	public ResourceLoader(String bundle){
		try{
			super.setResourceBundle(bundle);
		}catch (MissingResourceException e){
			Locale.setDefault(Locale.US);
			super.setResourceBundle(bundle);
		}
	}

	@Override
	public Icon getResourceAsIcon(String name) {
		return new ImageIcon(getClass().getResource(translate(name)));
	}

	@Override
	public Image getResourceAsImage(String name) {
		return new ImageIcon(getClass().getResource(translate(name))).getImage();
	}

}



